<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<!-- 引入样式 -->
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@1.6/lib/index.css">
		<!-- 引入组件 -->
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
		<script src="html5plus://ready"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@1.6/lib/vant.min.js"></script>
		<script src="../js/fanhui.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/tuichu.js" type="text/javascript" charset="utf-8"></script>
		<title></title>
		<script type="text/javascript">
			document.addEventListener('plusready', function() {
				//console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"

			});
		</script>
	</head>

	<body>
		<div id="app">
			<header>
				<van-cell style="background-color: red;" @click="btn">
					<img class="left-float"  style="border-radius: 50%; height: 100px;overflow:hidden; width:100px; margin:10px;" :src="img_src" />
					<span style="position: absolute;margin-top: 60px; color: white;">{{userName}}</span>
				</van-cell>
			</header>
			<section style="width: 100%;height:570px;background-color:	#DDDDDD;">
				<van-row>
					<van-col span="6">
						<van-goods-action-mini-btn icon="shopping-cart-o" text="待付款"@click="payment" siza="small" style="color: black;padding: 10px 10px;"></van-goods-action-mini-btn>
					</van-col>
					<van-col span="6">
						<van-goods-action-mini-btn icon="records" text="待收货" @click="receive" siza="small" style="color: black;padding: 10px 10px;"></van-goods-action-mini-btn>
					</van-col>
					<van-col span="6">
						<van-goods-action-mini-btn icon="other-pay" text="待评论" @click="dpj" siza="small" style="color: black;padding: 10px 10px;"></van-goods-action-mini-btn>
					</van-col>
					<van-col span="6">
						<van-goods-action-mini-btn icon="orders-o"  text="我的订单" @click="order" siza="small" style="color: black;padding: 10px 10px;"></van-goods-action-mini-btn>
					</van-col>
				</van-row>
				<van-row style="margin-top:10px ;">
					<van-cell title="个人资料"  @click="means" icon="contact" is-link />
				</van-row>
				<van-row>
					<van-cell title="收货地址" @click="address" icon="location-o" is-link />
				</van-row>
				<van-row>
					<van-cell title="我的收藏" @click="collect" icon="like-o" is-link />
				</van-row>
				<van-row style="margin-top:10px ;">
					<van-cell title="设置" @click="sz" icon="setting-o" is-link />
				</van-row>
			</section>
		</div>
		<script>
			var newUser = localStorage.getItem("user"); //从localStorage里取数据(字符串格式)
			newUser = JSON.parse(newUser); //把字符串格式转换成Json格式
			var vm = new Vue({
				el: "#app",
				data: {
					userName:"未登录",
					img_src:"../img/presonal_wei.jpg"
				},
				created: function() {
					var _this = this;
					console.log(newUser);//用户信息
					if (newUser != null) {
						_this.userName = newUser.UserData.NickName; //用户名
						_this.img_src = newUser.UserData.AvatarImage; //用户头像
					}
				},
				methods:{
					btn:function(){
						if(newUser!=null){
							plus.webview.open("../views/mainHtml/means.html");
						}else{
							plus.webview.open("../views/mainHtml/login.html","login");
						}
					},
					dpj:function(){
						var dp=plus.webview.open("../views/mainHtml/evaluation.html","daipingjia",{
							zindex:1,
							scrollIndicator:'none'
						})
					},
					order:function(){
						var order=plus.webview.open("../views/mainHtml/order.html","order",{
							zindex:1,
							scrollIndicator:'none'
						})
					},
					receive:function(){
						var receive=plus.webview.open("../views/mainHtml/receive.html","receive",{
							zindex:1,
							scrollIndicator:'none'
						})
					},
					payment:function(){
						var payment=plus.webview.open("../views/mainHtml/payment.html","payment",{
							zindex:1,
							scrollIndicator:'none'
						})
					},
					address:function(){
						var addre=plus.webview.open("../views/mainHtml/address.html","shouhuo",{
							top:"",
							bottom:"",
							zindex:1,
							scrollIndicator:'none'
						})
					},
					means:function(){
						var perso=plus.webview.open("../views/mainHtml/means.html","gerenziliao",{
							zindex:1,
							scrollIndicator:'none'							
						})						
					},
					collect:function(){
						var colle=plus.webview.open("../views/mainHtml/sc.html","sc",{
							zindex:1,
							scrollIndicator:'none'							
						})
					},
					sz:function(){
						var setti=plus.webview.open("../views/mainHtml/shezhi.html","shezhiye",{
							zindex:1,
							scrollIndicator:'none'	
						})
					}

				}
			})
		</script>
	</body>

</html>
